package com.epalmpay.service.group;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.epalmpay.entity.*;
import com.epalmpay.exception.ApplicationException;
import com.epalmpay.dto.merchantmanage.GroupInDTO;
import com.epalmpay.dto.merchantmanage.GroupListOutDTO;
import com.epalmpay.dto.merchantmanage.GroupOutDTO;
import com.epalmpay.dto.merchantmanage.GroupPayconfigInDTO;
import com.epalmpay.dto.merchantmanage.GroupPayconfigOutDTO;
import com.epalmpay.dto.merchantmanage.GroupWxconfigInDTO;
import com.epalmpay.dto.merchantmanage.GroupWxmenuInfoInDTO;
import com.epalmpay.dto.merchantmanage.GroupWxmenuInfoOutDTO;
import com.epalmpay.dto.merchantmanage.GroupWxtemplateInDTO;
import com.epalmpay.dto.merchantmanage.GroupWxtemplateListOutDTO;
import com.epalmpay.dto.merchantmanage.GroupWxtemplateOutDTO;
import com.epalmpay.dto.system.BaseOutDTO;
import com.epalmpay.dto.system.UserInDTO;
import com.epalmpay.util.*;
import com.epalmpay.util.Response;

/***
 * 设备服务类
 * @author tonywu
 *
 */
public interface IGroupService {
	
	

	/**获得大商户列表
	 * @param
	 * @return
	 * @throws Exception
	 */
	public List<GroupOutDTO> getGroupList(Integer industryID,
			Integer developeUserID,Date joinStart,Date joinEnd,String name,Page page) throws Exception;
	
	/**新增大商户
	 * @param groupInDTO
	 * @throws Exception
	 */
	public Long saveGroup(GroupInDTO groupInDTO)throws Exception;

	/*
	* 获取大商户ID和名称
	* */
	List<GroupOutDTO> getGroupIdAndName() throws Exception;

	/**
	 * 获取大商户的名称
	 * @param groupId
	 * @return
	 * @throws Exception
     */
	GroupOutDTO getGroupById(Long groupId) throws Exception;
	
	
	GroupOutDTO getGroupPhone(Long groupId) throws Exception;
	
	
	/**
	 * 大商户开户新增微信配置
	 * @param groupWxconfigInDTO
	 * @throws Exception
	 */
	public void saveGroupConfig(GroupWxconfigInDTO groupWxconfigInDTO)throws Exception;
	
	
	/**
	 * 大商户开户根据groupId修改微信
	 * @param groupWxconfigInDTO
	 * @throws Exception
	 */
	public void updateGroupConfig(GroupWxconfigInDTO groupWxconfigInDTO)throws Exception;
	
	
	/**
	 * 大商户开户根据groupId查询微信配置详情
	 * @param groupId
	 * @throws Exception
	 */
	public GroupWxconfig selectGroupWxconfigId(Long groupId)throws Exception;
	
	
	/**
	 * 大商户查询商户参数配置信息
	 * @param groupId
	 * @return
	 * @throws Exception
	 */
	public GroupPayconfigOutDTO selectPayconfigId(Long groupId)throws Exception;
	
	
	/**
	 * 大商户详情
	 * @param groupId
	 * @throws Exception
	 */
	public Group selectGroupInfo(Long groupId)throws ApplicationException;

	/**
	 * 查询商户的系统配置
	 * @param groupId
	 * @return
	 */
	public GroupConfig selectGroupSysConfig(Long groupId);
	/**
	 * 查询大商户是否开通钱包
	 * @param groupId
	 * @return
	 */
	public Boolean selectGroupModel(Long groupId);
	
	
	public GroupListOutDTO wxtemplateList(Long groupId,int type)throws ApplicationException;
	
	
	/**
	 * 大商户开户新增微信配置
	 * @param groupWxtemplateInDTO
	 * @throws Exception
	 */
	public void saveWxtemplate(GroupWxtemplateInDTO groupWxtemplateInDTO)throws ApplicationException;
	
	
	/**
	 * 删除模板
	 * @param groupWxtemplateInDTO
	 * @throws Exception
	 */
	public Boolean deleteWxtemplate(GroupWxtemplateInDTO groupWxtemplateInDTO)throws ApplicationException;
	
	
	/**
	 * 模板详情
	 * @param groupWxtemplateInDTO
	 * @throws Exception
	 */
	public GroupWxtemplateOutDTO findTemplate(GroupWxtemplateInDTO groupWxtemplateInDTO)throws ApplicationException;
	/**
	 * 重置密码
	 * @param userInDTO
	 * @throws Exception
	 */
	public Boolean resetPassword(UserInDTO userInDTO)throws ApplicationException;
	/**
	 * 修改密码
	 * @param userInDTO
	 * @throws Exception
	 */
	public BaseOutDTO updatePassword(UserInDTO userInDTO)throws ApplicationException;
	
	
	public void updateGroupPayconfig(GroupPayconfigInDTO groupPayconfigInDTO) throws Exception;

	public Boolean hasPayGroupCode(GroupInDTO groupInDTO) throws Exception;
	
	/**
	 * 微信菜单列表
	 * @param groupWxmenuInfoInDTO
	 * @return
	 * @throws ApplicationException
	 */
    public GroupListOutDTO wxMenuList(GroupWxmenuInfoInDTO groupWxmenuInfoInDTO)throws ApplicationException;
	
	
	/**
	 * 保存微信菜单
	 * @param groupWxmenuInfoInDTO
	 * @throws Exception
	 */
	public void saveWxMenu(GroupWxmenuInfoInDTO groupWxmenuInfoInDTO)throws ApplicationException;
	
	
	/**
	 * 删除微信菜单
	 * @param groupWxmenuInfoInDTO
	 * @throws Exception
	 */
	public BaseOutDTO deleteWxMenu(GroupWxmenuInfoInDTO groupWxmenuInfoInDTO)throws ApplicationException;
	
	
	/**
	 * 保存微信菜单
	 * @param groupWxmenuInfoInDTO
	 * @throws Exception
	 */
	public void updateWxMenu(GroupWxmenuInfoInDTO groupWxmenuInfoInDTO)throws ApplicationException;
	
	/**
	 * 同步微信菜单信息
	 * @param groupWxmenuInfoInDTO
	 * @throws ApplicationException
	 */
	public void synchronizeWxMenu(GroupWxmenuInfoInDTO groupWxmenuInfoInDTO)throws ApplicationException;
	
	/**
	 * 查询菜单详情
	 * @param groupWxmenuInfoInDTO
	 * @throws ApplicationException
	 */
	public GroupWxmenuInfoOutDTO  findWxmenuId(GroupWxmenuInfoInDTO groupWxmenuInfoInDTO)throws ApplicationException;
	
	
	public GroupWxmenuInfoOutDTO  findParentWxmenuId(GroupWxmenuInfoInDTO groupWxmenuInfoInDTO)throws ApplicationException;

	public GroupWxtemplateListOutDTO findTempInfosList(Long groupId, Integer type)throws ApplicationException;

	public GroupWxtemplateListOutDTO finishSaveTemplates(List<GroupWxtemplateInDTO> groupWxtemplateInsDTO)throws ApplicationException;

	public GroupOutDTO getGroupByNamed(String merchantName)throws ApplicationException;
    void saveGroupProtocol(GroupInDTO groupInDTO) throws ApplicationException;

	GroupOutDTO queryGroupProtocol(GroupInDTO groupInDTO)throws ApplicationException;

	List<Map> getGroupTrade(Map<String, Object> param);

	List<Map> getGroupTradeShop(Map<String, Object> param);



    void editGroup(GroupInDTO groupInDTO)throws ApplicationException;

	void saveGroupProfile(Map<String, Object> param);

	GroupProfile selectProfileByGroupid(Long id);

	void deleteGroupProfile(Map<String, Object> param);

	void updateGroupProfileById(Map<String, Object> param);

	void insertGroupPoster(Poster record);

	void updateGroupPoster(Poster record);

	Poster selectPosterByGroupid(Poster record);


	Response addAgent(String groupId, String principal,String legalPersonId, String principalMobile)throws ApplicationException;

    GroupOutDTO goEditRate(GroupInDTO groupInDTO)throws ApplicationException;

    void editGroupInfo(GroupInDTO groupInDTO)throws ApplicationException;

}
